import {
  editUserData, getUserInfoById
} from '@/service/user.js'
import { defineStore } from 'pinia'

const useUserStore = defineStore('user', {
  state: () => ({
    usersList: [],
	userInfo: {},
    usersTotalCount: 0
  }),
  actions: {
    async editUserDataAction(id, userInfo) {
      // 1.更新用户的数据
      const editResult = await editUserData(id, userInfo)
    },
	async queryUserInfoByUserId(user_id) {
		const res = await getUserInfoById(user_id)
		this.userInfo = res.data
	}
	
  }
})

export default useUserStore
